package t3;

public class demo2 {
    public static void main(String[] args) {
        String SportingGoods="篮球20个,足球35个,排球15个,网球10个,羽毛球40个";
        String []list=SportingGoods.split("\\D+");
        int total=0;
        for (String count:list) {
            if (!count.isEmpty()) total+=Integer.parseInt(count);
        }
        System.out.println("体育用品的总数为"+total);
    }
}
